﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Restrito/Site.Master" AutoEventWireup="true" CodeBehind="frmCategoria.aspx.cs" Inherits="WEB.Restrito.Pesquisar.frmCategoria" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">


 <asp:UpdatePanel ID="updPanel" runat="server">
        <ContentTemplate>
        

            <div align="center">
                <div class="alert-message error">
                    <asp:Label ID="lblErro" runat="server" Font-Bold="True"></asp:Label>
                </div>
                <div class="alert-message success">
                    <asp:Label ID="lblSucesso" runat="server" Font-Bold="True" ></asp:Label>
                </div>
            </div>

            <asp:MultiView ID="mtv" runat="server">
                <asp:View ID="viewListagem" runat="server" >
                    <asp:Panel ID="pnlListagem" runat="server" DefaultButton="btnPesquisar">

                        <div style="float: left; height: auto; width:100%; border-bottom:1px solid #CCC;"> 
                            <h3><asp:Image ID="Titulo_Imagem" runat="server" ImageUrl="~/Images/Icons/icon_panel_search.png" /> Categoria - Perquisar<asp:Label ID="Label1" runat="server" Text="" CssClass="lbl" /></h3> 
                        </div>

                        <div style="float: left; height: auto; width:100%; margin-top:10px;"> 

                            <div style="float:left; margin-left:0px;">
                                <asp:Label ID="lblPesquisarID" runat="server" AssociatedControlID="txtPesquisarID" Width="60px" Text="Identificador:" CssClass="lbl" /><br />
                                <asp:TextBox ID="txtPesquisarID" runat="server" Width="80px" CssClass="textBox"  MaxLength="10"></asp:TextBox>
                            </div>

                            
                            <div style="float:left; margin-left:10px;">
                                <asp:Label ID="Label2" runat="server" AssociatedControlID="txtPesquisarDescricao" Width="60px" Text="Descrição:" CssClass="lbl" /><br />
                                <asp:TextBox ID="txtPesquisarDescricao" runat="server" Width="320px" CssClass="textBox"  MaxLength="100"></asp:TextBox>
                            </div>

                        </div>

                        <br clear="all" />

                        <div style="float:left; height:auto; margin-bottom:20px; margin-top:10px; width:100%;">
                            <asp:Button ID="btnPesquisar" runat="server" Text="Pesquisar" CssClass="btn primary" OnClick="btnPesquisar_Click" />
                        </div>

                        <div style="float: left; height: auto;">
                            <h5><asp:Label ID="lblNumeroLinhas" runat="server" Text=""></asp:Label></h5>
                        </div>

                        <br clear="all" />

                        <div style="float: left; height: auto;  width: 100%; margin: 0px 0px 20px 0px;">
                            <asp:GridView ID="gvListagem" 
                                runat="server" 
                                AutoGenerateColumns="false"
                                ForeColor="#333333" 
                                GridLines="None"
                                AllowPaging="true"
                                PageSize="10"
                                ShowFooter="false"
                                Width="100%"
                                EmptyDataText="Nenhuma Categoria foi localizado!"
                                OnRowDataBound="gvListagem_RowDataBound"
                                OnRowCommand="gvListagem_RowCommand"
                                OnPageIndexChanging="gvListagem_PageIndexChanging"
                                OnRowCreated="gvListagem_RowCreated"
                                >
                                <Columns>
                                <asp:TemplateField HeaderText="ID">
                                    <ItemTemplate>
                                        <asp:Label ID="lblID" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Descrição">
                                    <ItemTemplate>
                                        <asp:Label ID="lblDescricao" runat="server" Text='<%# Eval("Descricao") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField>
                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:ImageButton ID="btnVisualizar" Text="Editar" runat="server" CausesValidation="false"
                                        CommandName="cmdVisualizar" CommandArgument='<%# Eval("ID")  %>' 
                                        ImageUrl="~/Images/Icons/icon_view.png" ToolTip='<%# String.Concat("Visualizar: ", Eval("Descricao")) %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField>
                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:ImageButton ID="btnEditar" Text="Editar" runat="server" CausesValidation="false"
                                        CommandName="cmdEditar" CommandArgument='<%# Eval("ID")  %>' 
                                        ImageUrl="~/Images/Icons/icon_edit.png" ToolTip='<%# String.Concat("Editar: ", Eval("Descricao")) %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField>
                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:ImageButton ID="btnDeletar" Text="Editar" runat="server" CausesValidation="false"
                                        CommandName="cmdDeletar" CommandArgument='<%# Eval("ID")  %>' 
                                        ImageUrl="~/Images/Icons/icon_delete.png" ToolTip='<%# String.Concat("Deletar: ", Eval("Descricao")) %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>

                                </Columns>
                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                <EditRowStyle BackColor="#999999" />
                                <FooterStyle BackColor="#284775" Font-Bold="True" ForeColor="White" />
                                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
                                <PagerStyle BackColor="#5D7B9D" ForeColor="White" HorizontalAlign="Center" />
                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                            </asp:GridView>
                        </div>

                        <br clear="all" />

                    </asp:Panel>
                 </asp:View>
            </asp:MultiView>
        </ContentTemplate>
    </asp:UpdatePanel>

</asp:Content>
